package com.sky.mapper;

import com.sky.dto.ShoppingCartDTO;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;

@Mapper
public interface UserShopingCartMapper {
    @Select("select * from shopping_cart")
    List<ShoppingCart> getlist();
    void add(ShoppingCart dto);
    @Delete("delete from shopping_cart where user_id = #{userid}")
    void clean(BigInteger userid);
    @Delete("delete from shopping_cart where user_id = #{userid} and setmeal_id = #{setmealid}")
    void subBysetmealId(Long setmealid, BigInteger userid);
    @Delete("delete from shopping_cart where user_id = #{userid} and dish_id = #{dishid}")
    void subBydishId(Long dishid, BigInteger userid);
    List<ShoppingCart> getBydishId_or_setmealId_or_userid(ShoppingCart shoppingCart);
    void update(ShoppingCart shoppingCart);
}
